﻿@model IEnumerable<HRM.Models.Employee>
@{
    ViewBag.Title = "Index";
}
<h2>
    Employee Managment</h2>
<div id="index-addlink" style="float: left; width: 50%">@Html.ActionLink("Create New Employee", "Create")</div>
@using (Html.BeginForm())
{
    <div style="float: left; width: 50%; text-align: right">
        Employee ID @Html.TextBox("empId")
        <input type="submit" id="btnSearch" value="Search" /></div>
}
<table class="view">
    <tr>
        <th>
            Name
        </th>
        <th>
            Designation
        </th>
        <th>
            Status
        </th>
        <th>
            Catagory
        </th>
        <th>
            Project
        </th>
       <th>
            Joining Date
        </th>
        <th>
            Contract Finish Date
        </th>
         <th>
        </th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Designation.Title)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Status)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Catagory.EmpCatagory)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Project.ProjectName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.JoiningDate)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ContractFinishDate)
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.EmployeeId }) |
                @Html.ActionLink("Details", "Details", new { id = item.EmployeeId }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.EmployeeId })
            </td>
        </tr>
    }
</table>
